package util;

public class StringUtil2 {

	
	//转换/r/n
	public static String toHtml(String str) {
		StringBuffer sb=new StringBuffer();
		String[] split = str.split("(/r/n)");
		for (String s : split) {
			sb.append("<p>");
			String replaceAll = s.replaceAll("(/r)", "<br>");
			sb.append(replaceAll);
			sb.append("</p>");
			sb.append("<br>");
		}
		return sb.toString();
		
	}
	//判断是否为手机号
	
	public static boolean istel(String str) {
		
	
		boolean matches = str.matches("^1(39) /d{8}$");
		return matches;
		
	}
	
	//判断是否为邮箱
	
	public static boolean isyouxiang(String str) {
		
		
		boolean matches = str.matches("^[a-zA-Z0-9]+@+(qq|163)+(\\.com|\\.cn)$");
		return matches;
		
	}
	
	
	
	
}
